import Types from '../actionTypes';
import {getSelfBeforeLsit, viewDetails} from '../../api';

const GET_RETURN_REVIEW_LIST = page => {
  return new Promise(((resolve, reject) => {
    getSelfBeforeLsit(page).then(res => {
      console.log(res);
      resolve({
        type: Types.GET_RETURN_REVIEW_LIST,
        data: res
      });
    }).catch(err => {
      console.log(err);
    });
  }));
};


const VIEW_DETAILS = refund_no => {
  return new Promise((resolve, reject) => {
    viewDetails(refund_no).then(res => {
      resolve({
        type: Types.VIEW_DETAILS,
        data: res.data
      });
    }).catch(err => {
      console.log(err);
    });
  });
};
export default {
  GET_RETURN_REVIEW_LIST,
  VIEW_DETAILS
};
